'use strict';

const orderController = require('../../app/controller/order.controller.js');


module.exports = function(app){
    app.route('/order/addOrder')
        .post(orderController.addOrder);

    app.route('/order/receiveOrder')
        .post(orderController.receiveOrder);

    app.route('/order/refuseOrder')
        .post(orderController.refuseOrder);

    app.route('/order/deliverOrder')
        .post(orderController.deliverOrder);

    app.route('/order/getOrderByMerchant/:icnum')
        .get(orderController.getOrderByMerchant);

    app.route('/order/getOrderById/:_id')
        .get(orderController.getOrderById);

    app.route('/order/getUnreceivedOrder/:icnum')
        .get(orderController.getUnreceivedOrder);

    app.route('/order/getReceivedOrder/:icnum')
        .get(orderController.getReceivedOrder);

    app.route('/order/getRefusedOrder/:icnum')
        .get(orderController.getRefusedOrder);

    app.route('/order/getDeliveringOrder/:icnum')
        .get(orderController.getDeliveringOrder);

    app.route('/order/getFinishedOrder/:icnum')
        .get(orderController.getFinishedOrder);

};